home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-08-28 | 1.4 KB | 60 lines | [TEXT/PJMM] |
- unit aCommand;
-
- { ================================================== }
-
- { hello . p - an examle of a simple nShell (tm) command. }
-
- { Copyright ( c ) 1994 Newport Software Development }
-
- { You may distribute unmodified copies of this file for noncommercial }
- { purposes . You may use this file as a reference when writing your }
- { own nShell ( tm ) commands . }
-
- { All other rights are reserved . }
-
- { ================================================== }
-
- interface
-
- { The NSHP unit defines the interfaces nshell to callbacks. See "nshp.p" }
-
- uses
- NSHC;
-
- { The routine "theCommand" is called by the nShell.lib to to the work of the command. }
-
- procedure theCommand (nshc_parms: t_nshc_parms; nshc_calls: t_nshc_calls);
-
- { ================================================== }
-
- implementation
-
- { ================================================== }
-
- { pascal 'main' for commands }
-
- procedure theCommand (nshc_parms: t_nshc_parms; nshc_calls: t_nshc_calls);
- var
- s: Str255;
- begin
-
- nshc_parms^.action := nsh_idle;
-
- if nshc_parms^.version <> NSHC_VERSION then
- begin
- s := 'This command is not of a compatible version.';
- NSH_putStr_err(nshc_calls, s);
- NSH_putchar_err(nshc_calls, RETURN_CHAR);
- nshc_parms^.result := NSHC_ERR_VERSION;
- end
- else
- begin
- s := 'hello from Pascal';
- NSH_putStr(nshc_calls, s);
- NSH_putchar(nshc_calls, RETURN_CHAR);
- nshc_parms^.result := 0;
- end;
-
- end;
-
- end.